package com.ioc.controller;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;

import javax.annotation.PostConstruct;

/**
 * @author lemonwan
 * <h1>Spring IoC 学习笔记</h1>
 */

@Controller
public class UserController {

    @Value("${metaData}")
    private String metaData;

    /**
     * <h2><@PostConstruct该注解是在调用构造方法初始化对象之后再调用方法设置值/h2>
     */
    @PostConstruct
    public void init() {
        System.out.println("metaData：" + metaData);
    }

}
